- Java Unit Testing
- A Simple Unit Test
- Assert Methods
- Matchers
- Testing for Exceptions
- Stub, Mock and Proxy Testing
- Subclass Mock Objects
- Mock Testing isn't Always Enough
- IO Testing
- Servlet Unit Testing
- Unit Testing with Dependency Injection Containers
- Database Unit Testing - Rollback Transactions
- Database Unit Testing - CRUD Testing
- Database Unit Testing - Test Data Creation
- Running Unit Tests With Ant
- Running Unit Tests With Maven
- Running Unit Tests Inside IntelliJ IDEA
- Code Coverage
- Design for Testability
- Test First Development
Java Unit Testing
Jakob Jenkov |
This trail is about unit testing in Java. Unit testing means testing the smaller units of your application, like classes and methods.
The reason you test your code is to prove to yourself, and perhaps to the users / clients / customers, that your code works.
Unit tests are typically automated, meaning once they are implemented, you can run them again and again. That is, your computer can run them again and again, while you do something else.
This tutorial uses JUnit to implement the unit tests. There are other unit test frameworks for Java too, like TestNG.
Feel Free to Contact Me
If you disagree with anything I write here about Java Unit Testing, or just have comments, questions, etc, feel free to send me an email. You wouldn't be the first to do so. You can find my email address on the about page.
| Tweet | |
Jakob Jenkov | |









